import pytest, time
from selenium.webdriver.common.by import By


class AdminDashboardsPageLocator:
    """
          admin portal 页面
         """
    # admin portal 页面
    admin_portal_page = (By.CSS_SELECTOR, '[id="root"]')
    # 初始页面展开的tab
    default_page_expanded = (By.CSS_SELECTOR, '[aria-expanded="true"]')

    # Dashboards_tab
    dashboards_tab = (By.XPATH, "//div[contains(@data-menu-id,'DASHBOARD_PLT')]")

    # admin portal 页面左侧栏的Dashboards下的Customer Resource按钮
    dashboards_customer_resource_tittle = (By.CSS_SELECTOR, '[path="/console/dashboardReport/customerResource"]')
    # admin portal 页面左侧栏的Dashboards下的Users按钮
    dashboards_users_tittle = (By.CSS_SELECTOR, '[path="/console/dashboardReport/userData"]')
    # admin portal 页面左侧栏的Dashboards下的User Status按钮
    dashboards_user_status_tittle = (By.CSS_SELECTOR, '[path="/console/dashboardReport/activeUserData"]')
    # admin portal 页面左侧栏的Dashboards下的Sales Amount按钮
    dashboards_sales_amount_tittle = (By.CSS_SELECTOR, '[path="/console/dashboardReport/salesAmountData"]')
    # admin portal 页面左侧栏的Dashboards下的Orders按钮
    dashboards_orders_tittle = (By.CSS_SELECTOR, '[path="/console/dashboardReport/orderData"]')
    # admin portal的Dashboards下的Customer Resource页面
    dashboards_customer_resource_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Dashboards下的Users页面
    dashboards_users_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Dashboards下的User Status页面
    dashboards_user_status_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Dashboards下的Sales Amount页面
    dashboards_sales_amount_page = (By.CSS_SELECTOR, '[class="main___3hPLf"]')
    # admin portal的Dashboards下的Orders页面
    dashboards_orders_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')

    # Dashboards下的Orders页面标题
    dashboards_orders_page_tittle = (By.XPATH, '(//*[@class="main___2UTYW"])[1]')
    # Dashboards下的Orders页面的by order type tab
    dashboards_orders_order_type_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-BY_ORDER"]')
    # Dashboards下的Orders的by order type tab页面Cumulative Data Tracking标题
    dashboards_orders_cumulative_data_tracking_tittle = (By.XPATH, '(//*[@class="antd4-tabs-content-holder"])/div/div[2]/div[1]/form/div/div[1]')
    # Dashboards下的Orders的by order type tab页面Total Orders区标题
    dashboards_orders_total_orders_tittle = (By.XPATH, '(//*[@class="main___3hPLf"])[2]/div/div[1]/div/div[1]')
    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区标题
    dashboards_orders_daily_data_tracking_tittle = (By.XPATH, '(//*[@class="table-view___2jwwv"])[2]/form/div/div[1]')
    # Dashboards下的Orders的by order type tab页面Daily Data Trend区标题
    dashboards_orders_daily_data_trend_tittle = (By.XPATH, '(//*[@class="echarts-view___RjYn2"])[2]/div[1]/div/div[2]/div[1]')
    # Dashboards下的Orders的by order type tab页面Daily Data Distribution区标题
    dashboards_orders_daily_data_distribution_tittle = (By.XPATH, '(//*[@class="echarts-view___RjYn2"])[2]/div[3]/div/div[2]/div[1]')

    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区的Total Orders字段
    orders_total_orders_field = (By.XPATH, '(//*[@class="antd4-table-thead"])[2]/tr/th[2]')
    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区的New字段
    orders_new_field = (By.XPATH, '(//*[@class="antd4-table-thead"])[2]/tr/th[3]')
    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区的Release字段
    orders_release_field = (By.XPATH, '(//*[@class="antd4-table-thead"])[2]/tr/th[4]')
    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区的Modify字段
    orders_modify_field = (By.XPATH, '(//*[@class="antd4-table-thead"])[2]/tr/th[6]')
    # Dashboards下的Orders的by order type tab页面Daily Data Tracking区的Renew字段
    orders_renew_field = (By.XPATH, '(//*[@class="antd4-table-thead"])[2]/tr/th[5]')

    # Dashboards的Orders的Settings按钮
    orders_settings_btn = (By.CSS_SELECTOR, '[class="more-components-dropdown___1tJV9"]')
    # Dashboards的Orders的Settings弹框中的Daily Email字段
    orders_settings_daily_email_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[3]/div/label')
    # Dashboards的Orders的Settings弹框中的Filter字段
    orders_settings_filter_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[4]')
    # Dashboards的Orders的Settings弹框中的Region字段
    orders_settings_region_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[5]/div[1]/div[1]/label')
    # Dashboards的Orders的Settings弹框中的Zone字段
    orders_settings_zone_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[5]/div[3]/div[1]/label')
    # Dashboards的Orders的Settings弹框中的Computing字段
    orders_settings_computing_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[7]/div[1]/div[1]')

    # Dashboards的Sale Amount的Settings按钮
    sales_amount_settings_btn = (By.CSS_SELECTOR, '[class="more-components-dropdown___1tJV9"]')
    # Dashboards的Sale Amount的Settings弹框中的Daily Email字段
    settings_daily_email_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[3]/div/label')
    # Dashboards的Sale Amount的Settings弹框中的Displayed Currency:字段
    settings_displayed_currency_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[4]/div/label')
    # Dashboards的Sale Amount的Settings弹框中的Filter字段
    settings_filter_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[5]')
    # Dashboards的Sale Amount的Settings弹框中的Currency字段
    settings_currency_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[6]/div/label')
    # Dashboards的Sale Amount的Settings弹框中的Region字段
    settings_region_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[7]/div[1]/div/label')
    # Dashboards的Sale Amount的Settings弹框中的Zone字段
    settings_zone_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[7]/div[3]/div/label')
    # Dashboards的Sale Amount的Settings弹框中的Computing字段
    settings_computing_field = (By.XPATH, '//*[@class="setting___1gQb3"]/div[9]/div[1]/div[1]')

    # Dashboards下的Users Status页面的Active tab
    dashboards_users_status_active_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-1"]')
    # Dashboards下的Users Status页面的Dunning tab
    dashboards_users_status_dunning_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-2"]')
    # Dashboards下的Users Status页面Active Data区标题
    dashboards_users_status_active_data_tittle = (By.XPATH, '(//*[@class="title___34nKt"])/span')
    # Dashboards下的Users Status页面Top 10 Users by Time Spent on CRE标题
    dashboards_users_status_time_spent_tittle = (By.CSS_SELECTOR, '[class="topLeft___r3FJY"]')
    # Dashboards下的Users Status页面DAU/MAU区标题
    dashboards_users_status_dau_mau_tittle = (By.CSS_SELECTOR, '[class="overview-top-card-title___e7gUF"]')
    # Dashboards下的Users Status页面Daily Data Tracking区标题
    dashboards_users_status_daily_data_tracking_tittle = (By.XPATH, '(//*[@class="common-up___3Q4TX"])[2]/div[1]')
    # Dashboards下的Users Status页面Daily Data Trend区标题
    dashboards_users_status_daily_data_trend_tittle = (By.XPATH, '(//*[@class="main___nqUPJ"])/div/div[1]')

